" basic options
set nocompatible
set hidden
set noswapfile

" plugins via vim-plug

let g:airline_theme='minimalist'
let g:airline#extensions#tabline#enabled = 1

let g:SuperTabDefaultCompletionType = "context"

let g:ale_completion_enabled = 1
let g:ale_fix_on_save = 1

call plug#begin('~/.vim-plug')

" ui
Plug 'erichain/vim-monokai-pro'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter'
Plug 'ervandew/supertab'
Plug 'junegunn/fzf'

" code
Plug 'dense-analysis/ale'
Plug 'preservim/tagbar'
Plug 'vim-scripts/commentToggle'

call plug#end()

" text options
filetype indent plugin on
syntax on
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set smarttab
set autoindent
set smartindent

" color/UI options
set splitbelow
set splitright
set background=dark
set number
set list
set listchars=tab:↦\ ,trail:·
set colorcolumn=79,80
set termguicolors
colorscheme monokai_pro

" menu options (wild mode behaves like bash)
set wildmode=longest,list
set wildmenu

" mouse/paste options
set mouse=a
"set paste
"set clipboard=unnamedplus

" set spell spelllang=en

" mappings
inoremap <C-Left> <Esc>:bprev<Return>i
nnoremap <C-Left> <Esc>:bprev<Return>
inoremap <C-Right> <Esc>:bnext<Return>i
nnoremap <C-Right> <Esc>:bnext<Return>

inoremap <C-Space> <Esc>:FZF<Return>i
nnoremap <C-Space> <Esc>:FZF<Return>

inoremap <C-LeftMouse> <Esc>:ALEGoToDefinition<Return>i
nnoremap <C-LeftMouse> <Esc>:ALEGoToDefinition<Return>

inoremap <F1> <Esc>:TagbarToggle<Return>i
nnoremap <F1> <Esc>:TagbarToggle<Return>

inoremap <F10> <Esc>:set spell spelllang=pt<Return>i
nnoremap <F10> <Esc>:set spell spelllang=pt<Return>
inoremap <F11> <Esc>:set spell spelllang=en<Return>i
nnoremap <F11> <Esc>:set spell spelllang=en<Return>
inoremap <F12> <Esc>:set nospell<Return>i
nnoremap <F12> <Esc>:set nospell<Return>
